<template>
  <div id="top_nav" style="margin-bottom: 1.2rem">
    <van-nav-bar v-if="meta.ret" :title="meta.title" left-text="返回" @click-left="$router.back()" left-arrow />
    <van-nav-bar v-if="!meta.ret" :title="meta.title" />
  </div>
</template>

<script>
export default {
  name: 'NavBar',
  props: {
    meta: {
      type: Object,
      default: () => {
        return {
          ret: false,
          title: '未知'
        }
      }
    }
  }
}
</script>

<style scoped lang=scss>
.van-nav-bar {
  position: fixed;
  width: 100%;
  background-color: #5babfb;
  top: 0;
  left: 0;
  /deep/ .van-nav-bar__title {
    color: #fff;
    font-size: 16px;
  }
}
</style>
